package study.day7;

import java.io.*;

public class T6 {
    //缓冲流读取文件
    public static void main(String[] args) {
        Reader reader=null;//FileReader-->Reader
        BufferedReader br=null;
        try {
            reader=new FileReader("C:\\Users\\DELL\\IdeaProjects\\file\\1.txt");
            br=new BufferedReader(reader);
            String line = br.readLine();
            while (line != null) {
                System.out.println(line);
                line = br.readLine();
            }
        } catch (FileNotFoundException e) {
            System.out.println("file not found");
        }catch (IOException e){
            e.printStackTrace();
        }finally {
            try {
                br.close();
                reader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
